import java.util.Scanner;

public class SquareRectangle {
    public static void putChars(char c,int n){
        //连续显示n个字符C
        while (n-->0)
            System.out.print(c);

    }
    public static void putSquare(int n){
        for (int i=0;i<n;i++)
        {
            putChars('*',n);
            System.out.println();
        }
    }
    public static void putRectangle(int w,int h){
        for (int i=0;i<h;i++)
        {
            putChars('*',w);
            System.out.println();
        }
    }



    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);
        System.out.print("正方形边长：");
        int n=stdIn.nextInt();
        putSquare(n);


        System.out.print("长方形的长：");
        int w=stdIn.nextInt();
        System.out.print("长方形的宽：");
        int h=stdIn.nextInt();

        putRectangle(w,h);




    }
}
